﻿<link rel="stylesheet" type="text/css" href="nepadmin/css/question.css">
<div class="layui-fluid" lay-title="问卷表单">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="form-group">
                <div class="layui-form-item" style="width: 400px">
                    <label class="layui-form-label">添加题目</label>
                    <div class="layui-input-block">
                        <select id="addquerstions" class="addquerstions" name="" lay-filter="addquerstions">
                            <option value="0">单选</option>
                            <option value="1">多选</option>
                            <option value="2">填空</option>
                            <option value="3">矩阵</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">问卷标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入问卷标题" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">问卷题目</label>
                    <div class="layui-input-block">
                        <div class="yd_box">

                        </div>
                    </div>
                </div>

                <div class="layui-form-item" style="padding: 15px;">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="form-group-submit">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- 模板 -->
    <div class=" all_660">
        <div class="xxk_box">
            <div class="xxk_conn hide">
                <div class="xxk_xzqh_box dxuan ">
                    <textarea name="" cols="" rows="" class="input_wenbk btwen_text btwen_text_dx" placeholder="单选题目"></textarea>
                    <div class="title_itram">
                        <div class="kzjxx_iteam">
                            <input name="" type="radio" value="" class="dxk">
                            <input name="" type="text" class="input_wenbk" value="" placeholder="选项">
                            <label>
                                <input name="" type="checkbox" value="" class="fxk"> <span>可填空</span>
                            </label> <a href="javascript:void(0);" class="del_xm">删除</a>
                        </div>
                    </div>
                    <a href="javascript:void(0)" class="zjxx">增加选项</a>

                    <div class="bjqxwc_box">
                        <a href="javascript:void(0);" class="qxbj_but">取消编辑</a>
                        <a href="javascript:void(0);" class="swcbj_but"> 完成编辑</a>
                    </div>
                </div>

                <div class="xxk_xzqh_box duoxuan hide">
                    <textarea name="" cols="" rows="" class="input_wenbk btwen_text btwen_text_duox" placeholder="多选题目"></textarea>
                    <div class="title_itram">
                        <div class="kzjxx_iteam">
                            <input name="" type="checkbox" value="" class="dxk">
                            <input name="" type="text" class="input_wenbk" value="选项" placeholder="选项">
                            <label>
                                <input name="" type="checkbox" value="" class="fxk"> <span>可填空</span></label>
                            <a href="javascript:void(0);" class="del_xm">删除</a>
                        </div>
                    </div>
                    <a href="javascript:void(0)" class="zjxx">增加选项</a>

                    <div class="bjqxwc_box">
                        <a href="javascript:void(0);" class="qxbj_but">取消编辑</a>
                        <a href="javascript:void(0);" class="swcbj_but"> 完成编辑</a>
                    </div>
                </div>

                <div class="xxk_xzqh_box tktm hide">
                    <textarea name="" cols="" rows="" class="input_wenbk btwen_text btwen_text_tk" placeholder="答题区"></textarea>

                    <div class="bjqxwc_box">
                        <a href="javascript:void(0);" class="qxbj_but">取消编辑</a>
                        <a href="javascript:void(0);" class="swcbj_but"> 完成编辑</a>
                    </div>
                </div>

                <div class="xxk_xzqh_box  hide">
                    <div class="line_dl"></div>
                    <div class="jztm">
                        <textarea name="" cols="" rows="" class="input_wenbk btwen_text" placeholder="题目"></textarea>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tbody>
                            <tr valign="top">
                                <td width="135">
                                    <h4 class="ritwenz_xx">左标题</h4>
                                    <textarea name="" cols="" rows="" class="leftbtwen_text" placeholder="例子：CCTV1，CCTV2，CCTV3"></textarea>
                                </td>
                                <td>
                                    <h4 class="ritwenz_xx  ">
                                        右侧选项文字
                                        <input type="radio" name="xz" value="0" checked="checked" class="xzqk">单选
                                        <input type="radio" value="1" name="xz" class="xzqk">多选
                                    </h4>
                                    <div class="title_itram">
                                        <div class="kzjxx_iteam">
                                            <input name="" type="text" class="input_wenbk jzwent_input" value="选项"
                                                   onblur="if(!this.value)this.value='选项'"
                                                   onclick="if(this.value&amp;&amp;this.value=='选项' )  this.value=''">
                                            <label>
                                                <input name="" type="checkbox" value="" class="fxk">
                                                <span>可填空</span></label> <a href="javascript:void(0);" class="del_xm">删除</a>
                                        </div>
                                        <div class="kzjxx_iteam">
                                            <input name="" type="text" class="input_wenbk jzwent_input" value="选项"
                                                   onblur="if(!this.value)this.value='选项'"
                                                   onclick="if(this.value&amp;&amp;this.value=='选项' )  this.value=''">
                                            <label>
                                                <input name="" type="checkbox" value="" class="fxk">
                                                <span>可填空</span></label> <a href="javascript:void(0);" class="del_xm">删除</a>
                                        </div>
                                        <div class="kzjxx_iteam">
                                            <input name="" type="text" class="input_wenbk jzwent_input" value="选项"
                                                   onblur="if(!this.value)this.value='选项'"
                                                   onclick="if(this.value&amp;&amp;this.value=='选项' )  this.value=''">
                                            <label>
                                                <input name="" type="checkbox" value="" class="fxk">
                                                <span>可填空</span></label> <a href="javascript:void(0);" class="del_xm">删除</a>
                                        </div>
                                    </div>
                                    <a href="javascript:void(0)" class="zjxx" style="margin-left: 0;">增加选项</a>
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <div class="bjqxwc_box">
                            <a href="javascript:void(0);" class="qxbj_but">取消编辑</a>
                            <a href="javascript:void(0);" class="swcbj_but"> 完成编辑</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['form', 'view', 'table', 'admin'], function () {
        var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , form = layui.form
            , view = layui.view
            , table = layui.table;

        var router = layui.router();
        var id = router.search.id;
        var question = {};
        form.render();

        if (id) {
            // 初始化
            $.ajax({
                type: 'get',
                url: '/cms/question/info/' + id + '?token=' + admin.loginToken,
                dataType: 'json',
                success: function (data) {
                    question = data.question;
                    if (question) {
                        form.val("form-group", {
                            "title": question.title // "name": "value"
                        });
                        // json
                        var subjectList = question.subjectList;
                        console.log(subjectList);
                        $.each(subjectList, function (index, subject) {
                            var index = subject.type;
                            var selectList = subject.selectList;
                            var movie_box = '<div class="movie_box" style="border: 1px solid rgb(255, 255, 255);"></div>';
                            var Grade = $(".yd_box").find(".movie_box").length + 1;
                            switch (index) {
                                case "0":
                                case "1":
                                case "2":
                                    var danxuan = "";
                                    if (index == "0") {
                                        danxuan = '【单选】';
                                    } else if (index == "1") {
                                        danxuan = '【多选】';
                                    } else if (index == "2") {
                                        danxuan = '【问答】';
                                    }
                                    var wjdc_list = '<ul class="wjdc_list" data_type="'+index+'"></ul>';
                                    wjdc_list = $(wjdc_list).append(' <li><div class="tm_btitlt"><i class="nmb">' + Grade + '</i>. <i class="btwenzi">'+subject.title+'</i><span class="tip_wz">' + danxuan + '</span></div></li>');
                                    if (selectList && selectList.length > 0) {
                                        $.each(selectList, function (index, select) {
                                            wjdc_list = $(wjdc_list).append(' <li><label><input name="" type="checkbox" value="" class="fxk"><span>'+select.title+'</span></label></li>');
                                        });
                                    }
                                    if (index == "2") {
                                        wjdc_list = $(wjdc_list).append('<li>  <label> <textarea name="" cols="" rows="" class="input_wenbk btwen_text btwen_text_dx" ></textarea></label> </li>');
                                    }
                                    movie_box = $(movie_box).append(wjdc_list);
                                    movie_box = $(movie_box).append('<div class="dx_box" data-t="' + index + '"></div>');
                                    break;
                                case "3":
                                    var wjdc_list = ' <div class="wjdc_list"><h4 class="title_wjht"><i class="nmb">' + Grade + '</i>. 请编辑问题!<span class="tip_wz">【矩阵】</span></h4>'
                                        + ' <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tswjdc_table"><tbody></tbody></table></div>';
                                    movie_box = $(movie_box).append(wjdc_list);
                                    movie_box = $(movie_box).append('<div class="dx_box" data-t="' + index + '"></div>');
                                    break;
                            }
                            $(movie_box).hover(function () {
                                var html_cz = "<div class='kzqy_czbut'><a href='javascript:void(0)' class='sy'>上移</a><a href='javascript:void(0)'  class='xy'>下移</a><a href='javascript:void(0)'  class='bianji'>编辑</a><a href='javascript:void(0)' class='del' >删除</a></div>"
                                $(this).css({"border": "1px solid #0099ff"});
                                $(this).children(".wjdc_list").after(html_cz);
                            }, function () {
                                $(this).css({"border": "1px solid #fff"});
                                $(this).children(".kzqy_czbut").remove();
                            });
                            $(".yd_box").append(movie_box);
                        })
                    }
                }
            });
        }

        form.on('select(addquerstions)', function(data){
            var index = data.value;
            if (index == "-1") {
                return;
            }
            var movie_box = '<div class="movie_box" style="border: 1px solid rgb(255, 255, 255);"></div>';
            var Grade = $(".yd_box").find(".movie_box").length + 1;
            switch (index) {
                case "0":
                case "1":
                case "2":
                    var danxuan = "";
                    if (index == "0") {
                        danxuan = '【单选】';
                    } else if (index == "1") {
                        danxuan = '【多选】';
                    } else if (index == "2") {
                        danxuan = '【问答】';
                    }
                    var wjdc_list = '<ul class="wjdc_list" data_type="'+index+'"></ul>';
                    wjdc_list = $(wjdc_list).append(' <li><div class="tm_btitlt"><i class="nmb">' + Grade + '</i>. <i class="btwenzi">请编辑问题？</i><span class="tip_wz">' + danxuan + '</span></div></li>');
                    if (index == "2") {
                        wjdc_list = $(wjdc_list).append('<li>  <label> <textarea name="" cols="" rows="" class="input_wenbk btwen_text btwen_text_dx" ></textarea></label> </li>');
                    }
                    movie_box = $(movie_box).append(wjdc_list);
                    movie_box = $(movie_box).append('<div class="dx_box" data-t="' + index + '"></div>');
                    break;
                case "3":
                    var wjdc_list = ' <div class="wjdc_list"><h4 class="title_wjht"><i class="nmb">' + Grade + '</i>. 请编辑问题!<span class="tip_wz">【矩阵】</span></h4>'
                        + ' <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tswjdc_table"><tbody></tbody></table></div>';
                    movie_box = $(movie_box).append(wjdc_list);
                    movie_box = $(movie_box).append('<div class="dx_box" data-t="' + index + '"></div>');
                    break;
            }
            $(movie_box).hover(function () {
                var html_cz = "<div class='kzqy_czbut'><a href='javascript:void(0)' class='sy'>上移</a><a href='javascript:void(0)'  class='xy'>下移</a><a href='javascript:void(0)'  class='bianji'>编辑</a><a href='javascript:void(0)' class='del' >删除</a></div>"
                $(this).css({"border": "1px solid #0099ff"});
                $(this).children(".wjdc_list").after(html_cz);
            }, function () {
                $(this).css({"border": "1px solid #fff"});
                $(this).children(".kzqy_czbut").remove();
            });
            $(".yd_box").append(movie_box);
        });

        $(".movie_box").hover(function () {
            var html_cz = "<div class='kzqy_czbut'><a href='javascript:void(0)' class='sy'>上移</a><a href='javascript:void(0)'  class='xy'>下移</a><a href='javascript:void(0)'  class='bianji'>编辑</a><a href='javascript:void(0)' class='del' >删除</a></div>"
            $(this).css({"border": "1px solid #0099ff"});
            $(this).children(".wjdc_list").after(html_cz);
        }, function () {
            $(this).css({"border": "1px solid #fff"});
            $(this).children(".kzqy_czbut").remove();
        });
        $(".yd_box").on("click", ".xy", function () {
            var leng = $(".yd_box").children(".movie_box").length;
            var dqgs = $(this).parent(".kzqy_czbut").parent(".movie_box").index();
            if (dqgs < leng - 1) {
                var czxx = $(this).parent(".kzqy_czbut").parent(".movie_box");
                var xyghtml = czxx.next().html();
                var syghtml = czxx.html();
                czxx.next().html(syghtml);
                czxx.html(xyghtml);
                czxx.children(".wjdc_list").find(".nmb").text(dqgs + 1);
                czxx.next().children(".wjdc_list").find(".nmb").text(dqgs + 2);
            } else {
                alert("到底了");
            }
        });
        $(".yd_box").on("click", ".sy", function () {
            var leng = $(".yd_box").children(".movie_box").length;
            var dqgs = $(this).parent(".kzqy_czbut").parent(".movie_box").index();
            if (dqgs > 0) {
                var czxx = $(this).parent(".kzqy_czbut").parent(".movie_box");
                var xyghtml = czxx.prev().html();
                var syghtml = czxx.html();
                czxx.prev().html(syghtml);
                czxx.html(xyghtml);
                czxx.children(".wjdc_list").find(".nmb").text(dqgs + 1);
                czxx.prev().children(".wjdc_list").find(".nmb").text(dqgs);
            } else {
                alert("到头了");
            }
        });
        $(".yd_box").on("click", ".del", function () {
            var czxx = $(this).parent(".kzqy_czbut").parent(".movie_box");
            var zgtitle_gs = czxx.parent(".yd_box").find(".movie_box").length;
            var xh_num = 1;
            czxx.parent(".yd_box").find(".movie_box").each(function () {
                $(".yd_box").children(".movie_box").eq(xh_num).find(".nmb").text(xh_num);
                xh_num++;
            });
            czxx.remove();
        });
        $(".yd_box").on("click", ".bianji", function () {
            $(this).siblings().hide();
            var dxtm = $(".dxuan").html();
            var duoxtm = $(".duoxuan").html();
            var tktm = $(".tktm").html();
            var jztm = $(".jztm").html();
            var dx_rq = $(this).parent(".kzqy_czbut").parent(".movie_box").find(".dx_box");
            var title = dx_rq.attr("data-t");
            var timlrxm = $(this).parent(".kzqy_czbut").parent(".movie_box").children(".wjdc_list").children("li").length;
            if (title == 0) {
                dx_rq.show().html(dxtm);
                var bjxm_length = dx_rq.find(".title_itram").children(".kzjxx_iteam").length;
                var dxtxx_html = dx_rq.find(".title_itram").children(".kzjxx_iteam").html();
                for (var i_tmxx = bjxm_length; i_tmxx < timlrxm - 1; i_tmxx++) {
                    dx_rq.find(".title_itram").append("<div class='kzjxx_iteam'>" + dxtxx_html + "</div>");
                }
                var texte_bt_val = $(this).parent(".kzqy_czbut").parent(".movie_box").find(".wjdc_list").children("li").eq(0).find(".tm_btitlt").children(".btwenzi").text();
                dx_rq.find(".btwen_text").val(texte_bt_val);
                var bjjs = 0;
                $(this).parent(".kzqy_czbut").parent(".movie_box").find(".wjdc_list").children("li").each(function () {
                    var ktksfcz = $(this).find("input").hasClass("wenb_input");
                    if (ktksfcz) {
                        var jsxz_kk = $(this).index();
                        dx_rq.find(".title_itram").children(".kzjxx_iteam").eq(jsxz_kk - 1).find("label").remove();
                    }
                    var texte_val = $(this).find("span").text();
                    dx_rq.find(".title_itram").children(".kzjxx_iteam").eq(bjjs - 1).find(".input_wenbk").val(texte_val);
                    bjjs++
                });
            }
            if (title == 1) {
                dx_rq.show().html(duoxtm);
                var bjxm_length = dx_rq.find(".title_itram").children(".kzjxx_iteam").length;
                var dxtxx_html = dx_rq.find(".title_itram").children(".kzjxx_iteam").html();
                for (var i_tmxx = bjxm_length; i_tmxx < timlrxm - 1; i_tmxx++) {
                    dx_rq.find(".title_itram").append("<div class='kzjxx_iteam'>" + dxtxx_html + "</div>");
                }
                var texte_bt_val = $(this).parent(".kzqy_czbut").parent(".movie_box").find(".wjdc_list").children("li").eq(0).find(".tm_btitlt").children(".btwenzi").text();
                dx_rq.find(".btwen_text").val(texte_bt_val);
                var bjjs = 0;
                $(this).parent(".kzqy_czbut").parent(".movie_box").find(".wjdc_list").children("li").each(function () {
                    var ktksfcz = $(this).find("input").hasClass("wenb_input");
                    if (ktksfcz) {
                        var jsxz_kk = $(this).index();
                        dx_rq.find(".title_itram").children(".kzjxx_iteam").eq(jsxz_kk - 1).find("label").remove();
                    }
                    var texte_val = $(this).find("span").text();
                    dx_rq.find(".title_itram").children(".kzjxx_iteam").eq(bjjs - 1).find(".input_wenbk").val(texte_val);
                    bjjs++
                });
            }
            if (title == 2) {
                dx_rq.show().html(tktm);
                var texte_bt_val = $(this).parent(".kzqy_czbut").parent(".movie_box").find(".wjdc_list").children("li").eq(0).find(".tm_btitlt").children(".btwenzi").text();
                dx_rq.find(".btwen_text").val(texte_bt_val);
            }
            if (title == 3) {
                dx_rq.show().html(jztm);
            }
        });
        $(".yd_box").on("click", ".zjxx", function () {
            var zjxx_html = $(this).prev(".title_itram").children(".kzjxx_iteam").html();
            $(this).prev(".title_itram").append("<div class='kzjxx_iteam'>" + zjxx_html + "</div>");
        });
        $(".yd_box").on("click", ".del_xm", function () {
            var zuxxs_num = $(this).parent(".kzjxx_iteam").parent(".title_itram").children(".kzjxx_iteam").length;
            if (zuxxs_num > 1) {
                $(this).parent(".kzjxx_iteam").remove();
            } else {
                alert("手下留情");
            }
        });
        $(".yd_box").on("click", ".dx_box .qxbj_but", function () {
            $(this).parent(".bjqxwc_box").parent(".dx_box").empty().hide();
            $(".movie_box").css({"border": "1px solid #fff"});
            $(".kzqy_czbut").remove();
        });
        $(".yd_box").on("click", ".swcbj_but", function () {
            var jcxxxx = $(this).parent(".bjqxwc_box").parent(".dx_box");
            var querstionType = jcxxxx.attr("data-t");
            switch (querstionType) {
                case "0":
                case "1":
                    var bjtm_xm_length = jcxxxx.find(".title_itram").children(".kzjxx_iteam").length;
                    var xmtit_length = jcxxxx.parent(".movie_box").children(".wjdc_list").children("li").length - 1;
                    var texte_bt_val_bj = jcxxxx.find(".btwen_text").val();
                    jcxxxx.parent(".movie_box").children(".wjdc_list").children("li").eq(0).find(".tm_btitlt").children(".btwenzi").text(texte_bt_val_bj);
                    for (var toljs = xmtit_length; toljs > 0; toljs--) {
                        jcxxxx.parent(".movie_box").children(".wjdc_list").children("li").eq(toljs).remove();
                    }
                    var bjjs_bj = 0;
                    jcxxxx.children(".title_itram").children(".kzjxx_iteam").each(function () {
                        var texte_val_bj = $(this).find(".input_wenbk").val();
                        var inputType = 'radio';
                        if (querstionType == "1") {
                            inputType = 'checkbox';
                        }
                        var li = '<li><label><input name="a" type="' + inputType + '" value=""><span>' + texte_val_bj + '</span></label></li>';
                        jcxxxx.parent(".movie_box").children(".wjdc_list").append(li);
                        bjjs_bj++
                        var kxtk_yf = $(this).find(".fxk").is(':checked');
                        if (kxtk_yf) {
                            var jsxz = $(this).index();
                            jcxxxx.parent(".movie_box").children(".wjdc_list").children("li").eq(jsxz + 1).find("span").after("<input name='' type='text' class='wenb_input'>");
                        }
                    });
                    break;
                case "2":
                    var texte_bt_val_bj = jcxxxx.find(".btwen_text").val();
                    jcxxxx.parent(".movie_box").children(".wjdc_list").children("li").eq(0).find(".tm_btitlt").children(".btwenzi").text(texte_bt_val_bj);
                    break;
                case "3":
                    jcxxxx.parent(".movie_box").children(".wjdc_list").children("table").children("tbody").empty();
                    var querstionType = jcxxxx.find(".xzqk:checked").val();
                    console.log(querstionType);
                    var title = jcxxxx.find("textarea.input_wenbk.btwen_text").val();
                    var x_iteam = new Array();
                    var y_iteam = " ," + jcxxxx.find(".leftbtwen_text").val();
                    jcxxxx.find(".title_itram").children("div.kzjxx_iteam").each(function () {
                        var texte_val_bj = $(this).find(".input_wenbk").val();
                        var checkbox = $(this).find("input.fxk").is(':checked');
                        x_iteam.push({name: texte_val_bj, checkbox: checkbox});
                    });
                    var y_iteams = y_iteam.split(",");
                    for (var item in y_iteams) {
                        var tr = '<tr>', td = '';
                        td += '<td>' + y_iteams[item] + '</td>';
                        for (var i = 0; i < x_iteam.length; i++) {
                            if (item != 0) {
                                if (x_iteam[i].checkbox) {
                                    td += '<td><input name="c1" type="text" value=""></td>';
                                } else {
                                    var inputType = 'radio';
                                    if (querstionType == "1") {
                                        inputType = 'checkbox';
                                    }
                                    td += '<td><input name="c1" type="' + inputType + '" value=""> </td>';
                                }
                            } else {
                                td += '<td>' + x_iteam[i].name + '</td>';
                            }
                        }
                        jcxxxx.parent(".movie_box").children(".wjdc_list").children("table").children("tbody").append(tr + td);
                    }
                    break;
            }
            $(this).parent(".bjqxwc_box").parent(".dx_box").empty().hide();
        });

        // 保存
        /* 监听提交 */
        form.on('submit(form-group-submit)', function (data) {
            var field = data.field;
            var questionData = {};
            questionData.title = field.title;
            // 数据
            var subjectArr = [];
            $(".yd_box .movie_box").each(function () {
                var subject = {};
                var subjectType = $(this).find(".wjdc_list").attr("data_type");
                var subjectNum = $(this).find(".wjdc_list .tm_btitlt .nmb").html();

                subject.type = subjectType;
                subject.orderNum = subjectNum;
                // 0单选1多选2填空
                var subjectTitle = $(this).find(".wjdc_list li .tm_btitlt .btwenzi").html();
                subject.title = subjectTitle;
                if (subjectType == "0" || subjectType == "1") {
                    var selectArr = [];
                    $(this).find(".wjdc_list li label").each(function () {
                        var select = {};
                        // 标题
                        var selectTitle = $(this).find("span").html();
                        select.title = selectTitle;
                        selectArr.push(select);
                    });
                    subject.selectList = selectArr;
                }
                subjectArr.push(subject);
            });
            console.log(subjectArr);
            questionData.subjectJson = JSON.stringify(subjectArr)
            var url = "/cms/question/save";
            if (id) {
                url = "/cms/question/update?_method=PUT";
                questionData.id = id;
            }
            admin.post({
                url: url,
                contentType: "application/json",
                data: JSON.stringify(questionData),
                success: function (res) {
                    if (res.code == 0) {
                        // 提醒保存成功，关闭当前弹窗
                        layer.msg(res.msg);
                        // layer.closeAll();
                        var hrefD = '/question/questionEdit';
                        view.tab.del(hrefD);
                        var href = '#/question/questionList';
                        admin.navigate(href)
                        //刷新
                        table.reload('list-table-question', {
                            url: '/cms/question/page?token=' + admin.loginToken,
                            page: {
                                curr: 1
                            }
                        })
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
            return false;
        });

    });
</script>
